package myTCPTest2;

import java.io.*;
import java.net.Socket;

public class CelientDemo {
    public static void main(String[] args) throws IOException {
        // 创建客户端Socket对象
        Socket s = new Socket("172.19.17.207", 12346);

        // 输出流
        BufferedWriter bufw = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
        BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
        String line;

        while ((line = buf.readLine()) != null) {
            if(line.equals("886")) break;
            /*// 获取输出流对象
            OutputStream os = s.getOutputStream();
            os.write("hello...".getBytes());*/
            bufw.write(line);
            bufw.newLine();
            bufw.flush();
        }

        s.close();
    }
}
